import request from '@/utils/request'

/**
 * 查询司机列表
 * @param {Object} query - 查询参数，包括分页、筛选条件等
 * @returns {Promise} - 返回车辆数据和分页信息
 */
export function listDriver(query) {
    return request({
        url: '/delivery/driver/list',
        method: 'get',
        params: query,
    });
}

/**
 * 新增司机
 */
export function addDriver(data) {
    return request({
        url: '/delivery/driver',
        method: 'post',
        data,
    });
}

/**
 * 更新司机信息
 */
export function updateDriver(data) {
    return request({
        url: '/delivery/driver',
        method: 'put',
        data,
    });
}

/**
 * 删除司机
 */
export function deleteDriver(driverNo) {
    return request({
        url: `/delivery/driver/delete/${driverNo}`,
        method: 'delete',
    });
}

/**
 * 批量删除司机
 */
export function deleteDrivers(driverNos) {
    return request({
        url: '/delivery/driver/batchDelete',
        method: 'post',
        data: driverNos,
    });
}